package controller;



import common.spring.base.BaseController;
import org.apache.commons.lang.StringUtils;


import javax.servlet.http.HttpServletRequest;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;

public class ManagerBaseController extends BaseController {

    final protected Map<String,Object> parseRequestParamMap(HttpServletRequest request) {
         Enumeration<String> argEnu = request.getParameterNames();
        Map<String,Object> args=new HashMap();
        while (argEnu.hasMoreElements()) {
            String argName = argEnu.nextElement();
            String[] value = request.getParameterValues(argName);
            if (value == null) {
                continue;
            }
            for (String v : value) {
                args.put(argName,v);
            }
            if(value.length>1){
                args.put(argName,value);
            }
        }
        return args;
    }



}
